@import "../../assets/styles/variables";

.message {
  $self: &;

  &__content {
    display: flex;
    max-width: 440px;
    margin-bottom: 25px;
    position: relative;
  }

  &__avatar {
    display: flex;
    flex-direction: column-reverse;
    cursor: pointer;
    .avatar {
      margin-right: 13px;
      margin-bottom: 5px;
    }
  }

  &__bubble {
    background: $colorToMessage;
    box-shadow: 0 5px 5px rgba(54, 116, 225, 0);
    border-radius: 22px 22px 22px 3px;
    margin-bottom: 8px;
    padding: 15px;
  }

  &__text {
    color: $white;
    font-size: 1em;
    line-height: 20px;
  }

  &__date {
    font-size: 12px;
    opacity: 0.5;
  }

  &__info {
    #{$self}__reply {
      span {
        color: $white;
        font-size: 13px;
        opacity: 0.5;
      }
    }
  }

  &__attachments {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 5px;
    justify-content: left;
    cursor: pointer;
    &-item {
      margin-right: 5px;
      order: 3;
      img {
        width: 100px;
        height: 100px;
        border-radius: 15px;
      }
    }

    &-item--onlyOneItem {
      order: 3;
      img {
        width: 220px;
        height: 220px;
      }
    }
  }

  &__icon-read {
    position: absolute;
    bottom: 8px;
    left: -30px;
    width: 17px;
    height: 17px;
  }

  &__icon--doubleTicks {
    background-image: url("../../assets/img/doubleTicks.svg");
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
  }

  &__icon--ticks {
    background-image: url("../../assets/img/ticks.svg");
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
  }

  &--isme {
    display: flex;
    flex-direction: row-reverse;

    #{$self}__content {
      margin-bottom: 15px;
      flex-direction: row-reverse;

    }

    #{$self}__avatar {
      padding: 20px 0 0 0;
      .avatar {
        margin-right: 0;
        margin-left: 13px;
      }
    }

    #{$self}__info {
      text-align: right;
    }

    #{$self}__attachments {
      justify-content: end;
    }

    #{$self}__bubble {
      background: $colorFromMessage;
      border: 1px solid #ececec;
      box-shadow: 0 4px 4px rgba(0, 0, 0, 0.0220444);
      border-radius: 22px 22px 3px 22px;
      order: 2;

      #{$self}__text {
        color: $black;
      }
    }
  }

  &--reply {
    padding: 15px 0 0 20px;

    #{$self}__content--borderLine {
      border-left: 2px;
      border-style: double;

      #{$self}__info {
        padding: 0 0 0 10px;

        #{$self}__name {
          color: $darkGray;
        }

        #{$self}__bubble {
          background: $darkGray;
        }

        #{$self}__date {
          color: $white;
          opacity: 0.6;
        }
      }
    }
  }
}